<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script type="text/javascript" src="./lib/jquery.js"></script>
  <script type="text/javascript">
    function foo (fn) {
      $.get('http://www.liulongbin.top:3006/api/getbooks', function (res) {
        // Ajax异步结果传回来之后采取调用fn
        fn(res.data)
      })
    }
    foo(function (data) {
      console.log(data)
    })
  </script>
</body>
</html>